package cn.edu.sicau.databasepp.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "room_type_table", schema = "sqlexcise", catalog = "")
public class RoomTypeTableEntity
{
    private long roomTypeId;
    private String roomType;

    @Id
    @Column(name = "room_type_id", nullable = false)
    public long getRoomTypeId()
    {
        return roomTypeId;
    }

    public void setRoomTypeId(long roomTypeId)
    {
        this.roomTypeId = roomTypeId;
    }

    @Basic
    @Column(name = "room_type", nullable = true, length = 8)
    public String getRoomType()
    {
        return roomType;
    }

    public void setRoomType(String roomType)
    {
        this.roomType = roomType;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RoomTypeTableEntity that = (RoomTypeTableEntity) o;
        return roomTypeId == that.roomTypeId &&
                Objects.equals(roomType, that.roomType);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(roomTypeId, roomType);
    }
}
